import Vue from 'vue'
import MintUI from 'mint-ui'
import 'mint-ui/lib/style.css'
import ElementUI from 'element-ui' 
import 'element-ui/lib/theme-default/index.css'  
import App from './App.vue'
import top from './components/top.vue'
import booksView from './components/booksView.vue'
import book from './components/book.vue'
import bookrack from './components/bookrack.vue'
import detail from './components/detail.vue'
import detail1 from './components/detail.vue'
import answer from './components/answer.vue'
import answerView from './components/answerView.vue'
import my from './components/my.vue'
import bianji from './components/bianji.vue'
import zhuanlan from './components/zhuanlan.vue'
import shoucang from './components/shoucang.vue'
import huati from './components/huati.vue'
import index1 from './components/login/index1.vue'
import registr from './components/login/registr.vue'
import login from './components/login/login.vue'
import daying from './components/daying.vue'
import shipin from './components/shipin.vue'
import wangye from './components/wangye.vue'
import tiwen from './components/tiwen.vue'
import share from './components/share.vue'
import guanzhu from './components/guanzhu.vue'
import search from './components/search.vue'
import shouViewa from './components/shoucang/shouViewa.vue'
import shouViewb from './components/shoucang/shouViewb.vue'
import shouViewc from './components/shoucang/shouViewc.vue'
import VueRouter from "vue-router"
import store from './vuex/store'

//开启debug模式
Vue.config.debug = true;
Vue.use(VueRouter);
Vue.use(MintUI)
import axios from 'axios'
Vue.prototype.$http = axios;



// 创建一个路由器实例并且配置路由规则
const router = new VueRouter({
  mode: 'history',
  base: __dirname,
  routes: [
      { path: '/', component:top },
      { path: '/top', component: top },
      { path:'/answer',component:answer},
      { path:'/answerView',component:answerView},  
      { path: '/book', component: book },
      { path:'/bookrack',component: bookrack },
      { path:'/zhuanlan',component: zhuanlan},
      { path:'/shoucang',component: shoucang},
      { path:'/huati', component: huati},
      { path: '/booksView', component:booksView },
      { path: '/daying', component:daying },
      { path: '/shipin', component:shipin },
      { path: '/wangye', component:wangye },
      { path: '/detail', component: detail },
      { path: '/tiwen', component: tiwen },
      { path: '/share', component: share },
      { path: '/guanzhu', component: guanzhu },
      { path:'/login/index1',component:index1,children:[
      { path: '/login/registr', component:registr},
      { path: '/login/login', component:login },
      ]},
      { path: '/login/login', component:login },
      { path: '/my', component:my },
      { path:'/bianji',component: bianji },
      { path: '/search', component: search },
      { path:'/shoucang/shouViewa',component:shouViewa},
      { path:'/shoucang/shouViewb',component:shouViewb},
      { path:'/shoucang/shouViewc',component:shouViewc},


  ]
})

// 路由器会创建一个 App 实例，并且挂载到选择符 #app 匹配的元素上。
const app = new Vue({
      router: router,
      store,
      render: h => h(App)
}).$mount('#app')

